import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

import AppCinema from "@pages/cinema/AppCinema";
import AppCinemaList from "@pages/cinema/AppCinemaList";
import AppCinemaPoster from "@pages/cinema/AppCinemaPoster";

import AppMovie from "@pages/movie/AppMovie";

import AppUserInfo from "@pages/user-info/AppUserInfo"

import AppNotFound from "@pages/not-found/AppNotFound";

import AppCitys from "@pages/citys/AppCitys";

const routes = [
    { name: "movie", path: '/movie', component: AppMovie, alias: '/' },

    { 
        name: "cinema", 
        path: '/cinema', 
        component: AppCinema,
        redirect: { name: 'cinemalist'},
        children: [
            {
                name: "cinemalist",
                path: "cinemalist",
                component: AppCinemaList
            },
            {
                name: "cinemaposter",
                path: "cinemaposter/:id",
                component: AppCinemaPoster
            }
        ] 
    },

    { name: "citys", path: '/citys', component: AppCitys },

    // { path: '/account', component: component },

    { name: "userinfo", path: '/userinfo', component: AppUserInfo },

    // { name: "movieitem", path: '/movieitem/:detail', component: AppMovieItem },

    { name: "notfound", path: '/not-found', component: AppNotFound },

    {
        path: "**",
        redirect: { name: "notfound" }
    }
]

const router = new VueRouter({
    mode: 'history',
    routes
})

export default router;
